package cn.kgc.springcloud.nacos.config;

import com.netflix.loadbalancer.RandomRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author: mosin
 * @version: v1.0  2022/8/17
 */
@Configuration
public class BeanConfig {

    @Bean
    @LoadBalanced   //  标识RestTemplate 对象在发送http请求时 使用负载均衡机制
    public RestTemplate  restTemplate(){

        return  new RestTemplate();
    }

}
